<?php
/* Report all errors except E_NOTICE */
error_reporting(E_ALL^E_NOTICE);
class Helper_Tool
{
	static function unicodeDecode($data)
	{  
	    function replace_unicode_escape_sequence($match) {
	      return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
	    }  
	  
	    $rs = preg_replace_callback('/\\\\u([0-9a-f]{4})/i', 'replace_unicode_escape_sequence', $data);
	  
	    return $rs;
	}  
}
		//$user_id=$_REQUEST['user_id'];
		$json=$_REQUEST['json'];
		$json=Helper_Tool::unicodeDecode($json);
		$json=str_replace(" ","",$json);
		$json=str_replace("\\n","",$json);
		$json=str_replace("\\\"","\"",$json);
		$json=str_replace(",{}","",$json);
		$json=str_replace("{},","",$json);
		$json3=array();
		$json3=explode(" ",$json);
		$json2=array();
		if($json3[0]=="\"" && $json3[count($json)]=="\"")
		{
			$j=0;
			for($i=1;$i<count($json)-1;$i++)
			{
				$json2[$j]=$json3[$i];
				$j++;
			}
			$json=implode(" ",$json2);
		} 
		$data[0]['pan']=$json;
		//$json2=json_decode($json,true);
		echo json_encode($data);
?>